"""
 Settings for AdrianRemembersMeApp
 
 You can overwrite any options in the main settings.py file.
 This will serve as default options.
"""

import settings as global_settings

# List all properties of global_settings into an dictionary.
# This way, we can ask global_settings.has_key('x') or Default
settings =  dict( [d for d in global_settings.__dict__.items() if d[0].isupper() and not d[0].startswith('_')] )

"""
Password Encryption
If True, ARM will store passwords using a safe hashing algorithm.
When a user forgets his password, he will be forced to reset it and create a new one.
If False, ARM will store passwords as plain text.
When a user forgets his password, he can request it to be sent to him by email.
WARNING - Don't change this value if your application already has stored users.
"""
ENCRYPTED_PASSWORDS = settings.get('ENCRYPTED_PASSWORDS', True)
PASSWORD_MIN_LEN    = settings.get('PASSWORD_MIN_LEN', 6)

"""
Only letters (a-z), numbers (0-9), and periods (.) are allowed.
Username must be between 3 and 30 characters long.
The first character of your username must be an ascii letter (a-z) or number (0-9).
"""
REGEX_USERNAME = settings.get('REGEX_USERNAME', r'^[a-zA-Z\d](?:[a-zA-Z\d]|\.(?!\.|$)){2,29}$')

"""
Booking of usernames? Sometimes you want to reserve some usernames
for yourself, or block usernames like 'sex'. Do it here
"""
USERNAME_BOOKING = settings.get('USERNAME_BOOKING', False)

#TODO: what about plurals? shouldn't plurals (and other variations) be booked automatically?
USERNAME_BOOKING_LIST =  settings.get('USERNAME_BOOKING_LIST', [
     'about',
     'account',
     'admin',
     'advertisers',
     'api',
     'applications',
     'better',
     'blog',
     'cache',
     'changelog',
     'chat',
     'codereview',
     'compare',
     'create',
     'cron',
     'delete',
     'developers',
     'download',
     'enterprise',
     'help',
     'hosting',
     'images',
     'jobs',
     'legal',
     'login',
     'logout',
     'logs',
     'media',
     'mobile',
     'news',
     'organizations',
     'plans',
     'poll',
     'popular',
     'profile',
     'projects',
     'rename',
     'security',
     'shop',
     'signup',
     'static',
     'status',
     'store',
     'stories',
     'tour',
     'translations',
     'video',
     'view',
     'wiki',
])
     
"""
Profile Image options.

USE_GRAVATAR                - If photo not found, tries to use gravatar.
DEFAULT_PROFILE_IMAGE       - is a url to a default profile picture (if user doesn't have any.)
DEFAULT_THUMBNAIL           - thumbnail equivalent.

PROFILE_IMAGE_MAX_SIZE  - Will always resize the photo to this.
THUMBNAIL_SIZE          - Thumbnail size.
"""
USE_GRAVATAR                = settings.get('USE_GRAVATAR', False)
DEFAULT_PROFILE_IMAGE       = settings.get('DEFAULT_PROFILE_IMAGE','/media/profile_default.png')
DEFAULT_THUMBNAIL           = settings.get('DEFAULT_THUMBNAIL', '/media/profile_thumb_default.png')
PROFILE_IMAGE_SIZE          = settings.get('PROFILE_IMAGE_SIZE', {'width': 256, 'height': 256})
THUMBNAIL_SIZE              = settings.get('THUMBNAIL_SIZE',{'width':32, 'height': 32})

"""
Use mail confirmation
When enabled, email account should be confirmed in the member creation
and enable the 'forgot password' feature
"""
USE_MAIL_CONFIRMATION = settings.get('USE_MAIL_CONFIRMATION',True) # changed to True


"""
The LOGIN URL where users should be redirected if not logged,
used with the `login_required()` decorator.
"""
LOGIN_URL = settings.get('LOGIN_URL','/accounts/login')
